#pragma once

#include <d3d9.h>
#include <d3dx9tex.h>
#include <d3dx9.h>

class DxManager
{
public:
	/* Singelton DXmanger is called in GlobalDefines.h */
	static DxManager &getInstance(){static DxManager pInstance;return pInstance;}

	DxManager(void);
	~DxManager(void);

	// direct3D functions

	bool initDirect3D(HWND hwnd,bool fullscreen);
	void beginRender(void);
	void endRender(void);
	void shutdown(void);

	void createCamera(float nearClip, float farClip);
	void moveCamera(D3DXVECTOR3 vec);
	void pointCamera(D3DXVECTOR3 vec,D3DXVECTOR3 up);
	LPDIRECT3DDEVICE9 getDevice(void);
	D3DMATERIAL9 getMat(void);
	LPD3DXMATRIXSTACK				MatrixStack; //this needs to be private
	LPDIRECT3DVERTEXDECLARATION9	VertexDeclaration;
	LPDIRECT3DVERTEXBUFFER9			Vertex_Buffer;
	LPDIRECT3DTEXTURE9				*LightMaps;
	LPDIRECT3DTEXTURE9				*Texture;

private:

	LPDIRECT3D9						pD3D;                                              
	LPDIRECT3DDEVICE9				pd3dDevice;

	D3DMATERIAL9					mtrl;
	

};
